<form class="tableform" method='post' action='index.php?app=aftersales&ctl=admin_returnproduct&act=dorefund' id="order-refunds-form">
    <input type='hidden' name='order_id' value='<{$order.order_id}>'>
    <input type='hidden' name='return_id' value='<{$return_id}>'>

    <div class="division">
        <table width="100%" cellspacing="0" cellpadding="0" border="0">
            <tr>
                <th><{t}>订单号：<{/t}></th>
                <td><{$order.order_id}> 【<{if $order.pay_status == 0}><{t}>未支付<{/t}><{elseif $order.pay_status == 6}><{t}>退款申请中<{/t}><{elseif $order.pay_status == 1}><{t}>已支付<{/t}><{elseif $order.pay_status == 2}><{t}>处理中<{/t}><{elseif $order.pay_status == 3}><{t}>部分付款<{/t}><{elseif $order.pay_status == 4}><{t}>部分退款<{/t}><{elseif $order.pay_status == 5}><{t}>已退款<{/t}><{/if}>】</td>
                <th><{t}>下单日期：<{/t}></th>
                <td><{$order.createtime|cdate:'SDATE_STIME'}></td>
            </tr>
            <tr>
                <th><{t}>商品总额：<{/t}></th>
                <td><{$order.cost_item|cur_odr:$order.currency}></td>
                <th><{t}>退款类型：<{/t}></th>
                <td id="pay_type"><{t}>原路返回<{/t}></td>
            </tr>
            <tr>
                <th><{t}>已付总金额：<{/t}></th>
                <td>
                    <h3 style="float:left;"><{$order.payed|cur_odr:$order.currency:false:true}></h3>
                    
                    &nbsp;&nbsp;&nbsp;&nbsp;
                    包含运费：
                    <{$order.shipping.cost_shipping|cur_odr:$order.currency:false:true}>
                
                </td>
                
                <th><{t}>退款方式：<{/t}></th>
                <td id="detail_type">
                    <select type="select" name="payment" id="dom_el_b5ab640" class=" x-select">
                        <{foreach from=$payment item=pays}>
                        <option value="<{$pays.app_id}>"><{$pays.app_name}></option>
                        <{/foreach}>
                    </select>
                </td>
            <tr>
                <th><{t}>退款总金额：<{/t}></th>
                <td colspan="3">                
                    <h3><{$refund_amount|cur_odr:$order.currency:false:true}></h3>
                    <{if($refund_amount > $order.payed)}>
                        <font color="red">
                         退款金额超过实付金额，按实付金额 <{$order.payed|cur_odr:$order.currency:false:true}> 全额退款。
                        </font>
                    <{/if}>
                </td>
            </tr>
        </table>
        <h5><{t}>订单包含的商品<{/t}></h5>
        <div class="division">
            <table cellspacing="0" cellpadding="3" width="100%" class="gridlist">
                <col class="span-3"/>
                <col class="span-auto"/>
                <col class="span-2"/>
                <thead>
                <tr>
                    <th style="width:20%"><{t}>货号<{/t}></th>
                    <th><{t}>商品名称<{/t}></th>
                    <th><{t}>价格<{/t}></th>
                    <th><{t}>数量<{/t}></th>
                </tr>
                </thead>
                <tbody>
                <{foreach from=$orderinfo item=items}>
                <tr>
                    <td><{$items.bn}></td>
                    <td><{$items.name|escape:"html"}></td>
                    <td><{$items.price}></td>
                    <td><{$items.nums}></td>
                </tr>
                <{/foreach}>
                </tbody>
            </table>
        </div>
        <h5><{t}>申请售后服务的商品<{/t}></h5>
        <div class="division">
            <table cellspacing="0" cellpadding="3" width="100%" class="gridlist">
                <col class="span-3"/>
                <col class="span-auto"/>
                <col class="span-2"/>
                <thead>
                <tr>
                    <th style="width:20%"><{t}>货号<{/t}></th>
                    <th><{t}>商品名称<{/t}></th>
                    <th><{t}>价格<{/t}></th>
                    <th><{t}>数量<{/t}></th>                    
                    <th><{t}>退款金额<{/t}></th>
                </tr>
                </thead>
                <tbody>
                <{foreach from=$info.product_data item=item}>
                <tr>
                    <td><{$item.bn}></td>
                    <td><{$item.name|escape:"html"}></td>
                    <td><{$item.price}></td>
                    <td><{$item.num}></td>
                    <td><{$item.refund_amount|cur_odr}></td>
                </tr>
                <{/foreach}>
                </tbody>
            </table>
        </div>
    </div>
</form>

<{area inject='.mainFoot'}>
<div class="table-action">
    <{button label=$___b2c="提交"|t:'b2c' id="order-refunds-form-submit" class="order-action" type="button"}>
</div>
<{/area}>

<script>
    (function(){
        var _form = $('order-refunds-form');
        var btn =$('order-refunds-form-submit');
        btn.addEvent('click',function(){
            _form.fireEvent('submit',{stop:$empty});
        });
    })();

    _form.store('target',{
        onSuccess:function(response){    
            alert(response)
            var hash_res_obj = JSON.decode(response);
            if (hash_res_obj.success != undefined && hash_res_obj.success != "")
            {
                try{
                    var _dialogIns = btn.getParent('.dialog').retrieve('instance');
                }catch(e){}
                if(_dialogIns)
                {	
                    _dialogIns.close();
                }
            }
        }
    });

</script>
